#include <stdio.h>
#include "transform.h"
void show_mat3x3(const mat3x3* m33)
{
    int i = 0, j = 0;
    printf("\r\n+----------+----------+----------+\r\n");
    for(i = 0; i < 3; i++){
        printf("|");
        for (j = 0; j< 3; j++) {
            printf("  %-8.3f|", m33->m[i][j]);
        }
        printf("\r\n+----------+----------+----------+\r\n");
    }
}
int main() {
    vec3 v3 = {10.f, 10.f, 1.f};
    M33_ONE(m33);
    show_mat3x3(&m33);
    m33_rotate(&m33, -45.f);
    mat3x3 m31;
    mat3x3 m32;
    mat3x3_inverse_copy(&m31, &m33);
    show_mat3x3(&m31);
    mat3x3_mult_mat3x3_copy(&m32, &m31, &m33);
    // m32 It should be identity matrix
    show_mat3x3(&m32);
    mat3x3_mult_v3(&m33, &v3);

    mat3x3_mult_v3(&m31, &v3);
    printf("(%f, %f)\r\n", v3.x, v3.y);
    return 0;
}
